<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <title>Document</title>
</head>

<body>
    <div style="width:500px;height:500px;margin:5% auto;border:1px solid;position: relative;">
        <div style="width:100%;height:40px;background:#eee;">
            <div class="d" style="width:50px;height:100%;float:left;background:wheat;color:white;">1</div>
            <div class="d" style="width:50px;height:100%;float:left;background:brown;color:white;">2</div>
            <div class="d" style="width:50px;height:100%;float:left;background:skyblue;color:white;">3</div>
        </div>
        <div class="div" style="width:100%;height:460px;background:wheat;z-index: 1;position:absolute;left:0;top:40;">
        </div>
        <div class="div" style="width:100%;height:460px;background:brown;z-index: 0;position:absolute;left:0;top:40;">
        </div>
        <div class="div" style="width:100%;height:460px;background:skyblue;z-index: 0;position:absolute;left:0;top:40;">
        </div>
    </div>
</body>


</html>
<script>
    $(document).ready(function () {
        $('.d').each(function (index, item) {
            $(this).click(function () {
                $('.div').eq(index).css('z-index', '1').siblings().css('z-index', '0')
            });
        });
    });
</script>